import threading
import time

num = 0

def doing():
    for i in range(4):
        global num
        num += 100
        # time.sleep(0.5)
        print(f'thread name: {threading.current_thread().name}, num ={num} ')

if __name__ == '__main__':
    thread_arr = [threading.Thread(target=doing) for i in range(40)]

    for t in thread_arr:
        t.start()

